import { EntitySchema } from '@mikro-orm/core';

export class LeRoles {
  id!: string;
  name?: string;
  describe?: string;
  visits?: unknown;
  createdTime?: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted?: boolean = false;
}

export const LeRolesSchema = new EntitySchema({
  class: LeRoles,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    name: { type: 'string', length: 20, nullable: true },
    describe: { type: 'string', length: 50, nullable: true, default: '暂无描述' },
    visits: { type: 'unknown', columnType: 'longtext', nullable: true },
    createdTime: { type: 'string', columnType: 'bigint', nullable: true },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', nullable: true, default: false },
  },
});
